//
//  LSInfoSearchTableViewCell.m
//  LaSaCivilAffairsDepartment
//
//  Created by 聂志康 on 2019/1/9.
//  Copyright © 2019 wpkj. All rights reserved.
//

#import "LSInfoSearchTableViewCell.h"

@implementation LSInfoSearchTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self.contentView addSubview:self.rightArrowImageView];
        [self.contentView addSubview:self.subTitleLabel];
        [self.contentView addSubview:self.mainTitleLabel];
        [self.contentView addSubview:self.bottomLabel];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    WS
    [self.subTitleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(weakSelf.contentView.mas_right).with.offset(-35);
        make.bottom.equalTo(weakSelf.mainTitleLabel.mas_bottom);
    }];
    [self.mainTitleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(weakSelf.subTitleLabel.mas_left).with.offset(-10);
        make.left.equalTo(weakSelf.contentView.mas_left).with.offset(15);
        make.top.equalTo(weakSelf.contentView.mas_top).with.offset(12);
    }];
    [self.bottomLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.contentView.mas_left).with.offset(15);
        make.bottom.equalTo(weakSelf.contentView.mas_bottom).with.offset(-8);
        make.right.equalTo(weakSelf.contentView.mas_right).with.offset(-25);
    }];
}

- (UIImageView *)rightArrowImageView {
    if (!_rightArrowImageView) {
        _rightArrowImageView = [[UIImageView alloc] initWithImage:[[UIImage imageNamed:@"jiantou"] changeWithNewTintColor:hexColor(999999)]];
        _rightArrowImageView.center = CGPointMake(ScreenWidth-20, LSInfoSearchTableViewCellHeight/2);
    }
    return _rightArrowImageView;
}

- (UILabel *)mainTitleLabel {
    if (!_mainTitleLabel) {
        _mainTitleLabel = [[UILabel alloc] init];
        _mainTitleLabel.textColor = hexColor(333333);
        _mainTitleLabel.font = [UIFont fontWithName:@"SourceHanSansCN-Regular" size:14];
    }
    return _mainTitleLabel;
}

- (UILabel *)subTitleLabel {
    if (!_subTitleLabel) {
        _subTitleLabel = [[UILabel alloc] init];
        _subTitleLabel.textColor = hexColor(666666);
        _subTitleLabel.font = [UIFont fontWithName:@"SourceHanSansCN-Regular" size:12];
    }
    return _subTitleLabel;
}

- (UILabel *)bottomLabel {
    if (!_bottomLabel) {
        _bottomLabel = [[UILabel alloc] init];
        _bottomLabel.textColor = hexColor(999999);
        _bottomLabel.font = [UIFont fontWithName:@"SourceHanSansCN-Regular" size:12];
    }
    return _bottomLabel;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
